<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<link href="css/base.css?v=20140103" rel="stylesheet" type="text/css" />
<title></title>
</head>
<style>

</style>
<body>
<div class="viewport" id="main_content"/>

<script type="text/javascript" src="js/jquery-1.8.1.min.js"></script>
<script type="text/javascript" src="js/handlebars-v1.2.0.js"></script>

<script id="showtype_1" type="text/x-handlebars-template">
<table class="tab">
	{{#each HistorySaleResList}}
    <tr>
    	<td width="1%" align="left" nowrap="nowrap">
        	<b>部门代码:</b>
        </td>
        <td align="left" >
        	{{Code}}
        </td>
        <td width="1%" align="left" nowrap="nowrap">
        	<b>部门名称:</b>
        </td>
        <td align="left" >
        	{{Name}}
        </td>
    </tr>
    <tr>
    	<td  width="1%" align="left" nowrap="nowrap">
        	<b>销售金额:</b>
        </td>
        <td align="left" >
        	¥{{SaleMoney}}
        </td>
	</tr>
	<tr><td colspan=4><div style="overflow:hidden;background:gray;height:1px;"></div></td></tr>
{{/each}}


	<tr><td colspan=4>合计：</td></tr>
	 
	<tr>
    	<td width="1%" align="left" nowrap="nowrap">
        	<b>部门代码:</b>
        </td>
        <td align="left" >
        	{{Code}}
        </td>
        <td width="1%" align="left" nowrap="nowrap">
        	<b>部门名称:</b>
        </td>
        <td align="left" >
        	{{Name}}
        </td>
    </tr>
    <tr>
    	<td  width="1%" align="left" nowrap="nowrap">
        	<b>销售金额:</b>
        </td>
        <td align="left" >
        	¥{{Total}}
        </td>
	</tr>
</table>
</script>

<script id="showtype_2" type="text/x-handlebars-template">
<table class="tab">
	{{#each HistorySaleResList}}
    <tr>
    	<td width="1%" align="left" nowrap="nowrap">
        	<b>品牌代码:</b>
        </td>
        <td align="left" >
        	{{Code}}
        </td>
        <td width="1%" align="left" nowrap="nowrap">
        	<b>品牌名称:</b>
        </td>
        <td align="left" >
        	{{Name}}
        </td>
    </tr>
    <tr>
    	<td  width="1%" align="left" nowrap="nowrap">
        	<b>销售金额:</b>
        </td>
        <td align="left" >
        	¥{{SaleMoney}}
        </td>
	</tr>
	<tr><td colspan=4><div style="overflow:hidden;background:gray;height:1px;"></div></td></tr>
{{/each}}

    <tr>
    	<td  width="1%" align="left" nowrap="nowrap">
        	<b>合计:</b>
        </td>
        <td align="left" >
        	¥{{Total}}
        </td>
	</tr>
</table>
</script>


<script id="showtype_3" type="text/x-handlebars-template">
<table class="tab">
	{{#each HistorySaleResList}}
    <tr>
    	<td width="1%" align="left" nowrap="nowrap">
        	<b>分类代码:</b>
        </td>
        <td align="left" >
        	{{Code}}
        </td>
        <td width="1%" align="left" nowrap="nowrap">
        	<b>分类名称:</b>
        </td>
        <td align="left" >
        	{{Name}}
        </td>
    </tr>
    <tr>
    	<td  width="1%" align="left" nowrap="nowrap">
        	<b>销售金额:</b>
        </td>
        <td align="left" >
        	¥{{SaleMoney}}
        </td>
	</tr>
	<tr><td colspan=4><div style="overflow:hidden;background:gray;height:1px;"></div></td></tr>
{{/each}}

    <tr>
    	<td  width="1%" align="left" nowrap="nowrap">
        	<b>合计:</b>
        </td>
        <td align="left" >
        	¥{{Total}}
        </td>
	</tr>
</table>
</script>


<script id="showtype_4" type="text/x-handlebars-template">
 <table class="tab">
	{{#each HistorySaleResList}}
    <tr>
    	<td width="1%" align="left" nowrap="nowrap">
        	<b>部门代码:</b>
        </td>
        <td align="left" >
        	{{DeptId}}
        </td>
        <td  width="1%" align="left" nowrap="nowrap">
        	<b>部门名称:</b>
        </td>
        <td align="left" >
        	{{DeptName}}
        </td>
    </tr>

<tr>
    	<td width="1%" align="left" nowrap="nowrap">
        	<b>商品代码:</b>
        </td>
        <td align="left" >
        	{{Code}}
        </td>
        <td  width="1%" align="left" nowrap="nowrap">
        	<b>商品名称:</b>
        </td>
        <td align="left" >
        	{{Name}}
        </td>
    </tr>
    
	<tr>
    	<td  align="left" nowrap="nowrap">
        	<b>销售数量:</b>
        </td>
        <td align="left" >
        	{{SaleCount}}
        </td>
        <td  align="left" nowrap="nowrap">
        	<b>销售金额:</b>
        </td>
        <td align="left" >
        	¥{{SaleMoney}}
        </td>
    </tr>

	<tr><td colspan=4><div style="overflow:hidden;background:gray;height:1px;"></div></td></tr>

{{/each}}

</table>
</script>


<script id="showtype_5" type="text/x-handlebars-template">
<table class="tab">
	{{#each HistorySaleResList}}
    <tr>
    	<td width="1%" align="left" nowrap="nowrap">
        	<b>供应商代码:</b>
        </td>
        <td align="left" >
        	{{Code}}
        </td>
        <td width="1%" align="left" nowrap="nowrap">
        	<b>名称:</b>
        </td>
        <td align="left" >
        	{{Name}}
        </td>
    </tr>
    <tr>
    	<td  width="1%" align="left" nowrap="nowrap">
        	<b>销售金额:</b>
        </td>
        <td align="left" >
        	¥{{SaleMoney}}
        </td>
	</tr>
	<tr><td colspan=4><div style="overflow:hidden;background:gray;height:1px;"></div></td></tr>
{{/each}}

    <tr>
    	<td  width="1%" align="left" nowrap="nowrap">
        	<b>合计:</b>
        </td>
        <td align="left" >
        	¥{{Total}}
        </td>
	</tr>
</table>
</script>


<script type="text/javascript">
	   var showtype=window.android.showtype();
	   var source=null;
	   var context = null;



	   if ('1'==showtype){
	      source=$("#showtype_1").html();
		  context = {"RealtimeSaleResList":[{"DeptName":"商城","DeptCode":"1001","SaleMoney":252494.04},{"DeptName":"道墟分店","DeptCode":"1002","SaleMoney":136}],"Result":"1","Message":""};
	   }
	   if ('2'==showtype){
	      source=$("#showtype_2").html();
		  context = {"RealtimeSaleResList":[{"DeptName":"商城","DeptCode":"1001","SaleMoney":252494.04},{"DeptName":"道墟分店","DeptCode":"1002","SaleMoney":136}],"Result":"1","Message":""};
	   }
	   if ('3'==showtype){
	      source=$("#showtype_3").html();
		  context = {"RealtimeSaleResList":[{"DeptName":"商城","DeptCode":"1001","SaleMoney":252494.04},{"DeptName":"道墟分店","DeptCode":"1002","SaleMoney":136}],"Result":"1","Message":""};
	   }
	   if ('4'==showtype){
	      source=$("#showtype_4").html();
	   	  context = {"RealtimeSaleResList":[{"GoodsCode":"535234","GoodsName":"红黄蓝219","GoodsSpec":null,"Price":219,"SaleCount":1,"DiscountMoney":0,"PreferentialMoney":0,"SaleMoney":219},{"GoodsCode":"535234","GoodsName":"红黄蓝219","GoodsSpec":null,"Price":219,"SaleCount":1,"DiscountMoney":0,"PreferentialMoney":0,"SaleMoney":219}],"Result":"1","Message":""};
	   }
	   if ('5'==showtype){
	      source=$("#showtype_5").html();
		  context = {"RealtimeSaleResList":[{"SupplierName":"宏达食品","DeptCode":"1001","SaleMoney":252494.04},{"SupplierName":"永旺家电","DeptCode":"1002","SaleMoney":136}],"Result":"1","Message":""};
	   }

       var template = Handlebars.compile(source);

	   eval( ' context=' + window.android.getjson() );
	   window.android.hidepdg();
	   
	   if ( context.Result == 0)
	   {
		   alert( context.Message );
	   }else{
		   var html = template( context );
		   $("#main_content").html( html );
	   }
</script>


</body>
</html>
